package com.yonghui.sandbox.service.impl;

import com.yonghui.sandbox.dto.LoginParamDTO;
import com.yonghui.sandbox.dto.LoginResultDTO;
import com.yonghui.sandbox.service.LoginService;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.Date;
import java.util.Random;

/**
 * @description: TODO
 * @author: zhangtong
 * @create: 2021-03-15 13:55
 **/
@DubboService(version = "1.0.0")
public class LoginServiceImp implements LoginService {

    @Override
    public LoginResultDTO getLoginInfo(LoginParamDTO loginParamDTO) {
        System.out.println(loginParamDTO);
        LoginResultDTO loginResultVO = new LoginResultDTO();
        loginResultVO.setName(loginParamDTO.getName());
        loginResultVO.setPwd(loginParamDTO.getPwd());
        loginResultVO.setId(2000);
        loginResultVO.setNickname("测试dubbo"+loginParamDTO.getName());
        Random random = new Random();
        int rNumber = random.nextInt(10000);
        loginResultVO.setPhone("1590089"+rNumber);
        loginResultVO.setSex(2);
        loginResultVO.setBirthday(new Date());
        return loginResultVO;
    }
}
